WIP: switch from IJ1 plugins to IJ2 plugins - #133
Conversation
|
Thanks @nanthony21, I appreciate you having a crack at this. It feels pretty evil to break people's macros, so I won't want to merge this Sounds like this is working for your purposes though, is that right? |
|
Yes, this change does allow the plugin to be accessed through However, I just found out that there is also a different way that I could access the plugin class directly from Python without needing to change how the plugin is loaded to ImageJ: from scyjava import jimport
MyPlugIn = jimport("my.plugin.MyPlugIn")So I think I should be able to do what I'm trying to do without getting this merged. Still there may be some benefit to using the updated way of declaring plugins, I'm not sure. |
|
@bogovicj How to proceed with this PR will depend on your requirements and goals for bigwarp. Since a requirement is to preserve backwards compatibility, I agree that you cannot just delete the original-ImageJ-style plugins. That said: is it a goal (even if later) to provide a "pure ImgLib2/SciJava" type plugin suite, not depending on I understand that that would be significant work, and you probably don't have time, in which case closing this PR makes sense. Then we can consider this plugin in "maintenance mode" rather than under active development. What do you think? |
Just wanted to open this PR before getting too far along to make sure that this is a change that might be accepted.
The 3 remaining plugins that use the IJ1 style of implementing
ij.plugin.Pluginhave been replaced with the IJ2 style of using the scijavaPluginannotation andCommandinterface.The plugin can now be used from the imagej API just like any other IJ2 plugin.
ImageJ.plugin().getPlugin("bdv.ij.BigWarpImagePlusPlugIn")can retrieve a reference to the class andA macro like is fine:
run("Big Warp")The main downside is that this no longer seems to work for reasons I don't fully understand:
run("Big Warp", "moving_image=my-moving-img-title.tif target_image=my-target-image-title.tif");I believe it is a problem with the
GenericDialogPlusand will result an an error like this:In order to enable passing arguments to the plugin I think the plugins will have to use the
@Parameterannotation as described here